/*    */ package provider;
/*    */ 
/*    */ import java.awt.image.BufferedImage;
/*    */ import java.io.File;
/*    */ import java.io.IOException;
import java.io.Serializable;
/*    */ import javax.imageio.ImageIO;
/*    */ 
/*    */ public class MapleCanvas implements Serializable
/*    */ {
    private static final long serialVersionUID = 202103;
/*    */   private final File file;
/*    */   private int width;
/*    */   private int height;
/*    */   private BufferedImage image;
/*    */   
/*    */   public MapleCanvas(int width, int height, File fileIn) {
/* 16 */     this.width = width;
/* 17 */     this.height = height;
/* 18 */     this.file = fileIn;
/*    */   }
/*    */   
/*    */   public int getHeight() {
/* 22 */     return this.height;
/*    */   }
/*    */   
/*    */   public int getWidth() {
/* 26 */     return this.width;
/*    */   }
/*    */   
/*    */   public BufferedImage getImage() {
/* 30 */     loadImageIfNecessary();
/* 31 */     return this.image;
/*    */   }
/*    */   
/*    */   private void loadImageIfNecessary() {
/* 35 */     if (this.image == null)
/*    */       try {
/* 37 */         this.image = ImageIO.read(this.file);
/*    */         
/* 39 */         this.width = this.image.getWidth();
/* 40 */         this.height = this.image.getHeight();
/* 41 */       } catch (IOException e) {
/* 42 */         throw new RuntimeException(e);
/*    */       }  
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\provider\MapleCanvas.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */